﻿@model qltscd.Models.ScreenClient.HSXScreenClient

@{
    ViewBag.Title = "Index";
}

<h2>Hãng sản xuất</h2>
@{
    Html.Telerik().Grid(Model.DSHangSanXuat)
    .Name("grdDSHSX")
    .DataKeys(keys => keys.Add(c => c.MaHangSanXuat))
    .Resizable(r => r.Columns(true))
    .Reorderable(r => r.Columns(true))
    .Sortable()
    .Pageable(paging => paging.Enabled(true).Style(GridPagerStyles.NextPreviousAndInput).PageSize(15))
    .Editable(editing => editing.Mode(GridEditMode.InCell))
    .ToolBar(t => {
        t.Custom()
            .Action("Create", "DanhMucHangSanXuat")
            .ButtonType(GridButtonType.ImageAndText)
            .ImageHtmlAttributes(new { @class = "t-icon t-add" })
            .Text("Thêm hãng sản xuất");
        t.SubmitChanges().ButtonType(GridButtonType.ImageAndText).SaveText("Lưu").CancelText("Hủy bỏ");
        t.Custom()
            .Text("In")
            .ButtonType(GridButtonType.ImageAndText)
            .Action("In", "HangSanXuat")
            .ImageHtmlAttributes(new {
                @style = "background-image: url('./../../../../../QuanLyThietBi/Content/Images/printer.png');"
            });
    })
    .DataBinding(databinding => {
        databinding.Server()
            .Select("Index", "HangSanXuat");
        databinding.Ajax()
            .Select("_Index", "HangSanXuat")
            .Insert("_Insert", "HangSanXuat")
            .Delete("_Delete", "HangSanXuat")
            .Update("_Update", "HangSanXuat");
    })
    .Columns(column => {
         column.Template(
            @<text>
                <input name="checkedRecords" type="checkbox" title="checkedRecords"
                />
            </text>)
            .ClientTemplate("<input name='checkedRecords' type='checkbox' title='checkedRecords'")
            .Width(30);
        column.Bound(o => o.TenHangSanXuat).Title("Tên hãng sản xuất").Width(200);
        column.Bound(o => o.TrangWeb).Title("Trang web").Width(130);
    })
    .Render();
}

